package com.irs.controller;

import com.irs.annotation.SysLog;
import com.irs.mapper.BusinessCommunityMapper;
import com.irs.pojo.BuildingInfo;
import com.irs.pojo.BusinessCommunity;
import com.irs.pojo.TbUsers;
import com.irs.service.impl.BusinessCommunityServiceImpl;
import com.irs.util.ResultUtil;
import org.apache.ibatis.annotations.Select;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class CommunityConterller {
    @Autowired
    BusinessCommunityMapper businessCommunityDao;

    @RequestMapping("/community/golist")
    public  String community(){
        //跳转页面
        return "page/community/communityList";
    }

    //查找list
    @GetMapping("/community/mecommunity/list")
    @ResponseBody//返回json数据
    public Object buildList() {
        List<BusinessCommunity> businessCommunityList = businessCommunityDao.select(new BusinessCommunity());
        //返回JSON
        System.out.println("小区");
        return  ResultUtil.ok(businessCommunityList, businessCommunityList.size());
    }



}
